package com.szly.phm.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * phm
 *
 * @author: git.jas0nch
 * date: 2021-11-19
 */

@Getter
public enum EnsurePlanEnum {

    NORMAL(0,"正常"),
    GENERAL(1,"普通"),
    URGENT(2,"紧急");

    @EnumValue
    private int code;
    @JsonValue
    private String message;

    EnsurePlanEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }
    public static String name(int code) {
        EnsurePlanEnum[] values = EnsurePlanEnum.values();
        for (EnsurePlanEnum value : values) {
            if (value.getCode()==code) {
                return value.getMessage();
            }
        }
        return "未知";
    }
}
